package com.ndp.fb.rdb.db.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.ndp.fb.rdb.api.EcGaClientInfoRdbService;
import com.ndp.fb.rdb.db.DaoTemplate;
import com.ndp.fb.rdb.db.impl.mapper.DefaultRowMapper;
import com.ndp.fb.rdb.model.ga.EcGaClientInfo;

import java.util.List;

/**
 * Created by infi.he on 2016/4/13.
 */
@Service
public class EcGaClientInfoRdbServiceImpl extends DaoTemplate implements EcGaClientInfoRdbService {

    public EcGaClientInfo getEcGaClientInfo() {
        List<EcGaClientInfo> all = findAll(DefaultRowMapper.autoRowMapper(EcGaClientInfo.class));
        if (all.size() > 0) {
            return all.get(0);
        } else {
            return null;
        }
    }
}
